﻿using KingsSharp.Common.Data;
using KingsSharp.Core;
using CRM.Admin.Contracts.Model.Sys;
using CRM.Admin.Contracts.Dto.Sys;
using System;
using System.Linq;

namespace CRM.Admin.Contracts.Contract.Sys
{
    public interface IAuthorizationService:IDependency
    {
        /// <summary>
        /// 权限集合
        /// </summary>
        IQueryable<Authorization> ItemAuthorization { get; }

        /// <summary>
        /// 新增权限
        /// </summary>
        /// <param name="dtos">角色信息dto</param>
        /// <returns></returns>
        OperationResult InsertAuthorization(params AuthorizationDto[] dtos);

        /// <summary>
        /// 编辑权限
        /// </summary>
        /// <param name="dtos">权限信息dto</param>
        /// <returns></returns>
        OperationResult UpdateAuthorization(params AuthorizationDto[] dtos);

        /// <summary>
        /// 新增或更新角色权限列表
        /// </summary>
        /// <param name="dtos">权限信息dto</param>
        /// <returns></returns>
        OperationResult InsertOrUpdateAuthorization(Guid RoleId, params AuthorizationDto[] dtos);

        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        OperationResult DeleteAuthorization(params Guid[] ids);
    }
}
